Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error on file upload to directories with setgid bit #3838

Merged
merged 1 commit into from
Oct 1, 2024

Conversation

robinkar
Copy link
Contributor

@robinkar robinkar commented Sep 30, 2024

It seems that I managed to introduce a regression in #3739, which I had missed during testing, but we noticed when testing 3.1.8 in a system where setgid bits are used. Sorry about that.

Uploading files to directories with the setgid bit set causes the response to the browser to be an internal server error as PosixFile.handle_upload returns the number of files affected by the chown operation to set the setgid bit rather than a Transfer or nil as intended.
This PR fixes that by explicitly checking whether the return value is a Transfer or not.

@johrstrom
Copy link
Contributor

3.1.8 is buggy with interactive applications. I'm waiting on #3827 to fix both the CI and the httpd proxy bug in 3.1.8.

PosixTransfer will return the result of Pathname.chown (number of files
affected by operation) in directories with setgid bit set, which will
be considered a true value, but can not be used for render
"transfer/show".
@robinkar robinkar force-pushed the fix-upload-error-setgid branch from 7f86e8e to a94f8b9 Compare October 1, 2024 05:39
@robinkar
Copy link
Contributor Author

robinkar commented Oct 1, 2024

Rebased onto master so the CI now works.

@johrstrom johrstrom self-requested a review October 1, 2024 13:07
@johrstrom johrstrom merged commit 7d37f50 into OSC:master Oct 1, 2024
23 checks passed
johrstrom pushed a commit that referenced this pull request Oct 7, 2024
PosixTransfer will return the result of Pathname.chown (number of files
affected by operation) in directories with setgid bit set, which will
be considered a true value, but can not be used for render
"transfer/show".
johrstrom added a commit that referenced this pull request Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants